import { SDKState, ResultCallback } from "../SDKConfig";
import EventList from "../../cfw/event/EventList";
import BaseChannel from "./BaseChannel";



export default class BaseRecorder extends EventList{


    protected recorder: any;

    protected videoPath: string = null;

    protected state: SDKState = SDKState.close

    protected channel:BaseChannel;

    constructor(c:BaseChannel){
        super();
        this.channel = c;
    }
    start(obj?: any) { }
    pause() { }
    resume() { }
    stop(isSave: boolean = true,callback:ResultCallback) { }
    //记录精彩的视频片段
    recordClip(object) { }

    changeState(s) {
        this.state = s;
        this.emit(this.state)
    }

    getVideoPath() {
        return this.videoPath;
    }

    clear() {
        this.videoPath = null;
    }

    isOpen() {
        return this.state == SDKState.open;
    }

    isClose() {
        return this.state == SDKState.close;
    }

    getState() {
        return this.state;
    }

}
